import subprocess

for i in range(1, 21):
    print(i)
    command = "python detect.py --source /home/l/Desktop/step4_express/01/light/light_"+ str(i)+" --output /home/l/Desktop/step4_express/app/100/light/100_light_"+ str(i)+" --save-txt --weights runs/train/yolov4_5yuan/weights/last.pt --cfg /home/l/lab-1523/fh/exp/图像/检测/PyTorch_YOLOv4-master/cfg/yolov4_5.cfg --names /home/l/lab-1523/fh/exp/图像/检测/PyTorch_YOLOv4-master/data/5yuan/coco_5.names"
    try:
        subprocess.call(command, shell=True)
    except subprocess.CalledProcessError as e:
        print("命令执行出错:", e)
